{extends file="../home.html"}
{block name="title"}{$head_title}{/block}
{block name="css"}
<link rel="stylesheet" type="text/css" href="/Public/Css/front/front_css/title.css">
<style type="text/css">
	body{
		background-color: #f3f3f3;
	}
</style>
{/block}
{block name="content"}
<div class="title">
	
	<div class="go_back"></div>
	<p><strong>{$head_title}</strong></p>
</div>
<div class="photo">
	<div style="width:4rem;height:4rem;position:absolute;left:40%;top:1.0rem;">
	<img class="head_photo" src="{$user_info.headimgurl}?imageView2/1/w/200/h/200/imageslim">
	<span class="camara"></span>
	</div>
</div>
<div class="nickname">
	<span  class="ni" >昵称</span>
	<span class="name">{$user_info.nickname}</span>
</div>
<div class="gender">
	<span  class="ni" >性别</span>
	<span class="name">{if $user_info.sex == 1}男{elseif $user_info.sex == 2}女{/if}</span>
</div>
<div class="Signature">
	<span  class="ni" >个性签名</span>
	<textarea class="signature" placeholder="输入个性签名" maxlength="50">{$user_info.sdasd}</textarea>
	<span class="now_num">0</span>
</div>
<span class="save">保存</span>


<!--成功弹框-->
<div class="Popupsuccess">
	<i class="done"></i>
	<p></p>
</div>
<!--失败弹框-->
<div class="Popupdefeat">
	<div class="defeat"></div>
	<p></p>
</div>

{/block}
{block name="js"}
<script>
	var num = 0
</script>
{literal}
<script type="text/javascript">

	$('.now_num').html($('.signature').val().length+'/50');
	$('.signature').on('input propertychange',function(){
		num = $('.signature').val().length;
		console.log(num);
		$('.now_num').html(num+'/50');
	});

	//保存
	$('.save').on('click',function(){
		var sdasd = $('.signature').val();
		$.ajax({
			type:'post',
			url:'/FrontUserCenter/user_info',
			data:{sdasd:sdasd},
			success:function (data) {
				if(data.code == 1){
					// $('.Popupsuccess').find('p').html(data.msg);
					// $('.Popupsuccess').fadeIn(1500);
					// $('.Popupsuccess').fadeOut(2000);
					toast(data.msg,'succ');
				}else{
					// console.log(data.msg)
					// $('.Popupdefeat').find('p').html(data.msg);
					// $('.Popupdefeat').fadeIn(1500);
					// $('.Popupdefeat').fadeOut(2000);
					toast(data.msg,'fail');
				}
			}
		})
	});

	$('.head_photo').on('click',function () {
		native_listen('upheadimg');
	})





</script>
{/literal}
{/block}
